<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation {
    
    function MY_Form_validation()
    {
        parent::CI_Form_validation();
    }
    
    function date($str)
    {
        if(preg_match('@\d{1,2}-\d{1,2}-\d{1,4}@is', $str)) {
            return true;
        }
        else return false;
    }
    
    function url($href)
    {
        if(preg_match('@http:\/\/@is', $href)) {
            return true;
        }
        else return false;
    }
    
    function get_error_array()
    {
        $errors = array();
        
        foreach($this->_error_array as $msg) {
            if($msg) $errors[] = $msg;
        }

        return $errors;
    }
    /*
    function run($module = '', $group = '')
    {
        (is_object($module)) AND $this->CI =& $module;
        return parent::run($group);
    }
    */
}
